$gutter = 25px;
$radius = 13px;

@import '_partial/archives.styl';
@import '_partial/article.styl';
@import '_partial/py.styl';
@import '_partial/searchbox.styl';
@import './color.styl';

*, *:after, *::before {
    box-sizing: border-box;
}

a {
    text-decoration: none;
}

body {
    max-width: 1100px;
    margin: auto !important;
}

.catalogue {
}

.medium-zoom-overlay {
    z-index: 9999;
}

.medium-zoom-image--opened {
    z-index: 9999;
    background: rgba(31, 34, 36, 0.925);
    box-shadow: 0 1em 3em 0.5em rgba(0, 0, 0, 0.25);
}

#nexmoe-background {
    .nexmoe-bg {
        opacity: 0.2;
        background-size: cover;
        filter: blur(30px);
        height: 100vh;
        width: 100%;
        position: fixed;
        top: 0;
        left: 0;
        z-index: -1;
    }

    .mdui-appbar {
        padding: 10px;
        display: none;

        img {
            width: 100%;
        }
    }
}

@media screen and (max-width: 1023px) {
    #nexmoe-background {
        .mdui-appbar {
            display: block !important;
        }
    }
}

#nexmoe-header {
    margin-left: -240px;

    .mdui-drawer {
        left: unset;
        scrollbar-width: none;
    }

    .mdui-drawer::-webkit-scrollbar {
        display: none;
    }

    .nexmoe-avatar, .nexmoe-avatar img {
        width: 100%;
        font-size: 0 0;
        border-radius: 80px;
        -webkit-border-radius: 80px;
        -moz-border-radius: 80px;
        box-shadow: inset 0 -1px 0 #333 sf;
        -webkit-transition: -webkit-transform 1.5s ease-out;
        -moz-transition: -moz-transform 1.5s ease-out;
        transition: transform 1.5s ease-out;
    }

    .nexmoe-avatar {
        margin: 45px;
        z-index: 4;
        position: relative;
        font-size: 0;
        width: calc(100% - 90px);
        overflow: hidden;
        border-radius: 100%;
        box-shadow: 0 0.3rem 2rem rgba(161, 177, 204, 0.6);

        a {
            padding-bottom: 100%;
            display: block;
            height: 0;
        }
    }

    .nexmoe-count {
        padding: 0 30px;
        margin-bottom: 30px;
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;

        div {
            -webkit-box-flex: 1;
            -ms-flex: 1;
            flex: 1;
            text-align: center;
            color: #a3a8ae;

            span {
                color: #363636;
                display: block;
            }
        }
    }

    .nexmoe-search {
        input {
            border: none !important;
            background-color: transparent;
            padding: 20px;
            box-sizing: border-box;
            outline: none;
        }
    }

    input::-webkit-search-decoration, input::-webkit-search-cancel-button {
        display: none !important;
    }

    .nexmoe-social {
        padding: 12px;
        font-size: 0;

        a {
            width: 36px;
            height: 36px;
            line-height: 36px;
            margin: 4px;
            border-radius: 100%;
            display: inline-block;
            text-align: center;
            color: #606266;
        }
    }

    .nexmoe-list {
        padding: 8px 20px;

        .nexmoe-list-item {
            padding: 0 36px;
            color: #9ca2a8;
            border-radius: $radius;
            margin-bottom: 10px;
            text-align: center;
            transition: none!important;
        }

        .nexmoe-list-item.true, .nexmoe-list-item.true i {
            color: #fff;
        }

        .nexmoe-list-item.true {
            opacity: 0.9;
            background: $color1;
            box-shadow: 0 2px 12px $color1;
        }

        .nexmoe-list-item i {
            font-size: 22px;
            color: #9ca2a8;
        }

        .nexmoe-list-item .mdui-list-item-content {
            margin-left: 0px;
        }
    }

    .nexmoe-widget-wrap {
        box-shadow: 0 0 1rem rgba(161, 177, 204, 0.4);
        background-color: #fff;
        margin: 20px;
        border-radius: $radius;
        overflow: hidden;
        white-space: normal;

        .nexmoe-widget-title {
            font-size: 1em;
            font-weight: 400;
            padding: 24px 18px 12px;
            margin: 0;
            color: $color1;
        }

        .nexmoe-widget {
            ul {
                list-style-type: none;
                padding: 0;
                margin: 0;

                li {
                    overflow: hidden;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                    position: relative;
                    padding: 12px 18px;

                    a {
                        color: #606266;
                    }
                }

                li:last-child {
                    border-bottom: none;
                    padding-bottom: 24px;
                }
            }

            .category-list-count, .archive-list-count {
                background-color: rgba(hexo-config('color.first.r'), hexo-config('color.first.g'), hexo-config('color.first.b'), 0.1);
                display: inline-block;
                width: 26px;
                height: 26px;
                line-height: 26px;
                text-align: center;
                border-radius: 100%;
                color: $color1;
                position: absolute;
                right: 18px;
                top: 10px;
            }
        }

        .tagcloud {
            padding: 10px;
                padding-bottom: 6px;
                padding-top: 11px;

            a {
                border-radius: $radius;
                padding: 5px 10px;
                font-size: 12px !important;
                display: inline-block;
                margin-bottom: 5px;
            }

            a:before {
                content: '# ';
            }
        }
    }

    .nexmoe-widget-wrap:first-child {
        margin-top: 0;
    }

    .nexmoe-copyright {
        padding: 0 30px;
        text-align: center;
        color: #777;
        white-space: normal;
        margin-bottom: 20px;
        font-size: 12px;
        a {
            color: $color1;
        }
    }
}

@media screen and (max-width: 1024px) {
    #nexmoe-header {
        margin-left: 0;

        .mdui-drawer {
            left: 0;
        }
    }
}

#nexmoe-content {
    position: relative;

    .nexmoe-primary {
        box-shadow: 0 0 1rem rgba(161, 177, 204, 0.4);
        background-color: #fff;
        float: left;
        width: 100%;
        padding: $gutter;
        position: absolute;
        min-height: 100vh;

        .nexmoe-page-nav {
            list-style: none;
            text-align: center;
            display: inline-block;
            color: #ddd;
            background-color: #f5f6f5;
            border-radius: $radius;
            margin-top: -10px;

            .prev {
                margin-left: 8px;
            }

            .current {
                color: #fff;
                background: $color1;
                opacity: 0.9;
                box-shadow: 0 2px 12px $color1;
            }
        }

        .nexmoe-page-nav > * {
            color: #999;
            border-radius: $radius;
            width: 35px;
            height: 35px;
            line-height: 35px;
            margin-right: 8px;
            float: left;
        }
    }

    .nexmoe-posts {
        position: relative;

        .nexmoe-post {
            width: 100%;
            margin-bottom: 40px;

            article p:first-child {
                margin-top: 0;
            }

            article p:last-child {
                margin-bottom: 0;
            }
        }

        .nexmoe-post-meta {
            margin: 10px 0 !important;
        }

        .nexmoe-post:last-child {
            margin-bottom: $gutter;
        }
    }

    .nexmoe-post {
        .nexmoe-post-cover {
            width: 100%;
            padding-bottom: 56.25%;
            position: relative;
            overflow: hidden;
            border-radius: 16px;
            min-height: 95px;
            background-color: #eee;

            img {
                display: block;
                opacity: 0;
                transition: opacity 400ms ease-out;
                position: absolute;
                left: 0;
                top: 0;
                object-fit: cover;
                width: 100%;
                height: 100%;
            }

            img.lazyloaded {
                opacity: 1;
            }

            h1 {
                color: #fff;
                font-size: 2.5em;
                font-weight: normal;
                margin: 0;
                margin-top: 10px;
                padding-left: 1px;
                position: absolute;
                bottom: 0;
                width: 100%;
                box-sizing: border-box;
                text-transform: none;
                z-index: 1;
                margin: 0;
                padding: $gutter;
            }

            h1:after {
                background-image: -moz-linear-gradient(to top, rgba(16, 16, 16, 0.35) 25%, rgba(16, 16, 16, 0) 100%);
                background-image: -webkit-linear-gradient(to top, rgba(16, 16, 16, 0.35) 25%, rgba(16, 16, 16, 0) 100%);
                background-image: -ms-linear-gradient(to top, rgba(16, 16, 16, 0.35) 25%, rgba(16, 16, 16, 0) 100%);
                background-image: linear-gradient(to top, rgba(16, 16, 16, 0.35) 25%, rgba(16, 16, 16, 0) 100%);
                -moz-pointer-events: none;
                -webkit-pointer-events: none;
                -ms-pointer-events: none;
                pointer-events: none;
                background-size: cover;
                content: '';
                display: block;
                height: 100%;
                left: 0;
                position: absolute;
                bottom: 0;
                width: 100%;
                z-index: -1;
            }
        }

        .nexmoe-post-meta {
            margin: $gutter 0px;
            font-size: 0;

            a {
                border-radius: 20px;
                padding: 10px 18px;
                font-size: 14px;
                display: inline-block;
                margin-bottom: 5px;
                margin-right: 10px;
                text-decoration: none;

                .nexmoefont {
                    font-size: 14px;
                }
            }

            a:before, i:before {
                margin-right: 5px;
            }
        }

        .nexmoe-post-copyright {
            margin: 0 -25px;
            margin-bottom: 25px;
            padding: 25px;
            color: #191919;
            background-color: #fafafa;
            line-height: 1.5em;
            position: relative;
            overflow: hidden;

            a {
                color: $color1;
            }
        }

        .nexmoe-post-copyright:after {
            position: absolute;
            background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 496 512'%3E%3Cpath fill='%234a4a4a' d='M245.8 214.9l-33.2 17.3c-9.4-19.6-25.2-20-27.4-20-22.2 0-33.3 14.6-33.3 43.9 0 23.5 9.2 43.8 33.3 43.8 14.4 0 24.6-7 30.5-21.3l30.6 15.5a73.2 73.2 0 01-65.1 39c-22.6 0-74-10.3-74-77 0-58.7 43-77 72.6-77 30.8-.1 52.7 11.9 66 35.8zm143 0l-32.7 17.3c-9.5-19.8-25.7-20-27.9-20-22.1 0-33.2 14.6-33.2 43.9 0 23.5 9.2 43.8 33.2 43.8 14.5 0 24.7-7 30.5-21.3l31 15.5c-2 3.8-21.3 39-65 39-22.7 0-74-9.9-74-77 0-58.7 43-77 72.6-77C354 179 376 191 389 214.8zM247.7 8C104.7 8 0 123 0 256c0 138.4 113.6 248 247.6 248C377.5 504 496 403 496 256 496 118 389.4 8 247.6 8zm.8 450.8c-112.5 0-203.7-93-203.7-202.8 0-105.5 85.5-203.3 203.8-203.3A201.7 201.7 0 01451.3 256c0 121.7-99.7 202.9-202.9 202.9z'/%3E%3C/svg%3E");
            content: ' ';
            height: 160px;
            width: 160px;
            right: -30px;
            top: -45px;
            opacity: 0.1;
        }
    }

    .nexmoe-post-footer {
        background-color: #f5f6f5;
        padding: $gutter;
        margin: -($gutter);
        margin-top: 0;
    }
}

#nexmoe-content:after {
    clear: both;
    display: table;
    content: ' ';
}

@media screen and (max-width: 1024px) {
    #nexmoe-content {
        .nexmoe-primary {
            width: 100%;
            position: relative;
            min-height: 100vh;
        }

        .nexmoe-secondary {
            display: none;
        }
    }
}

@media screen and (min-width: 1024px) {
    body {
        padding-left: 0px;
    }

    #nexmoe-header .mdui-drawer-close {
        display: none;

        .nexmoe-avatar {
            padding: 16px;
            width: 80px;
            margin-left: 160px;
            margin-top: 8px;
        }

        .nexmoe-count {
            padding: 16px;
            width: 80px;
            margin-left: 160px;
            display: block;
        }

        .nexmoe-count div {
            display: block;
            margin-bottom: 10px;
        }

        .nexmoe-count div:last-child {
            margin-bottom: 0;
        }

        .mdui-list {
            margin-left: 160px;
        }

        .nexmoe-list-item {
            padding: 0 17px;
            color: #9ca2a8;
            
        }

        .mdui-list-item-icon~.mdui-list-item-content {
            margin-left: 32px;
        }

        .nexmoe-list {
            padding: 8px 10px;
        }
    }
}

@keyframes shake-it {
    0% {
        text-shadow: 0 0 rgba(0, 255, 255, 0.5), 0 0 rgba(255, 0, 0, 0.5);
    }

    25% {
        text-shadow: -1px 0 rgba(0, 255, 255, 0.5), 1px 0 rgba(255, 0, 0, 0.5);
    }

    50% {
        text-shadow: -3px 0 rgba(0, 255, 255, 0.5), 1px 0 rgba(255, 0, 0, 0.5);
    }

    100% {
        text-shadow: 1px 0 rgba(0, 255, 255, 0.5), 3px 0 rgba(255, 0, 0, 0.5);
    }
}

.nexmoe-post-right {
    margin: 0px 0 - $gutter;
    text-align: right;
}

.nexmoe-valign {
    display: -webkit-box !important;
    display: -webkit-flex !important;
    display: -ms-flexbox !important;
    display: flex !important;
    -webkit-box-align: center !important;
    -webkit-align-items: center !important;
    -ms-flex-align: center !important;
    align-items: center !important;
    height: 100%;
}

.nexmoe-post-right .nexmoe-fixed {
    position: fixed;
    z-index: 1000;
    height: 100vh;
    display: inline-block;
    top: 0;
}

.nexmoe-post-right .nexmoe-tool {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 56px;

    button {
        margin-top: 20px;

        .icon-i-catalog {
            font-size: 22px;
        }

        .icon-caret-top {
            font-size: 20px;
        }
    }
}

.nexmoe-post-right .nexmoe-tool .mdui-fab {
    background: #fff;
    color: #444;
}

@media screen and (max-width: 1024px) {
    .nexmoe-post-right {
        margin: $gutter 0px;
        text-align: left;
    }

    .nexmoe-post-right .nexmoe-fixed {
        height: auto;
        top: auto;
        bottom: 0;
        right: 0;
    }

    .nexmoe-post-right .nexmoe-tool {
        right: 20px;
        left: auto;
    }

    #nexmoe-header .nexmoe-social a {
        margin: 10px;
        width: 44px;
        height: 44px;
        line-height: 44px;
    }
}

.nexmoe-toc {
    width: auto;
    text-align: left;
    box-shadow: 0 0 1rem rgba(161, 177, 204, 0.4);
    background-color: #fff;
    position: absolute;
    bottom: 0px;
    right: 0;
    border-radius: 16px;
    padding: 20px;
    font-size: 16px;
    display: none;
    z-index: 0;
    max-height: calc(100vh - 130px);
    overflow-y: scroll;
}

.nexmoe-tool .catalog:hover .nexmoe-toc {
    display: block;
}

.nexmoe-toc a {
    color: rgba(0, 0, 0, 0.6);
}

.nexmoe-toc a:hover {
    text-decoration: underline;
    color: $color1;
}

.nexmoe-toc ol {
    padding-left: 1em;
    margin: 0;
}

.nexmoe-toc li {
    margin: 0;
    line-height: 1.7rem;
}

.nexmoe-toc > ol {
    margin: 0;
    padding: 0;
}

.nexmoe-toc * {
    list-style: none;
}

photos img {
    width: 25%;
}

.nexmoe-rainbow {
    a:nth-child(7n+1) {
        background-color: $nrbgc1;
        color: $color1;
    }

    a:nth-child(7n+2) {
        background-color: $nrbgc2;
        color: $color2;
    }

    a:nth-child(7n+3) {
        background-color: $nrbgc3;
        color: $color3;
    }

    a:nth-child(7n+4) {
        background-color: $nrbgc4;
        color: $color4;
    }

    a:nth-child(7n+5) {
        background-color: $nrbgc5;
        color: $color5;
    }

    a:nth-child(7n+6) {
        background-color: $nrbgc6;
        color: $color6;
    }

    a:nth-child(7n+7) {
        background-color: $nrbgc7;
        color: $color7;
    }
}

.nexmoe-rainbow-fill {
    a:nth-child(7n+1) {
        color: #fff;
        background-color: $nrfbgc1;
    }

    a:nth-child(7n+2) {
        color: #fff;
        background-color: $nrfbgc2;
    }

    a:nth-child(7n+3) {
        color: #fff;
        background-color: $nrfbgc3;
    }

    a:nth-child(7n+4) {
        color: #fff;
        background-color: $nrfbgc4;
    }

    a:nth-child(7n+5) {
        color: #fff;
        background-color: $nrfbgc5;
    }

    a:nth-child(7n+6) {
        color: #fff;
        background-color: $nrfbgc6;
    }

    a:nth-child(7n+7) {
        color: #fff;
        background-color: $nrfbgc7;
    }
}